/* 基本重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局样式 */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    width: 80%;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    background-color: #333;
    color: #fff;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 1.5rem;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #4CAF50;
}

/* 语言切换按钮样式 */
.language-switch {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background-color: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.lang-btn.active {
    background-color: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

/* 深色/浅色模式切换按钮样式 */
.theme-toggle {
    background-color: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 深色模式样式 */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background-color: #1e1e1e;
}

body.dark-mode .hero {
    background-color: #2d4a30;
}

body.dark-mode .about {
    background-color: #1e1e1e;
}

body.dark-mode .about h2,
body.dark-mode .projects h2,
body.dark-mode .skills h2,
body.dark-mode .contact h2,
body.dark-mode .timeline h3,
body.dark-mode .achievements h3 {
    color: #e0e0e0;
}

body.dark-mode .timeline-content {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .timeline-content p {
    color: #b0b0b0;
}

body.dark-mode .projects {
    background-color: #1e1e1e;
}

body.dark-mode .project-item {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .project-item h3 {
    color: #e0e0e0;
}

body.dark-mode .project-item p {
    color: #b0b0b0;
}

body.dark-mode .skills {
    background-color: #1e1e1e;
}

body.dark-mode .skill-bar {
    background-color: #3a3a3a;
}

body.dark-mode .contact {
    background-color: #1e1e1e;
}

body.dark-mode .contact-info a {
    color: #66bb6a;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background-color: #2a2a2a;
    border-color: #4a4a4a;
    color: #e0e0e0;
}

body.dark-mode .form-group input::placeholder,
body.dark-mode .form-group textarea::placeholder {
    color: #808080;
}

body.dark-mode .footer {
    background-color: #1e1e1e;
}

/* 返回顶部按钮深色模式样式 */
body.dark-mode #backToTop {
    background-color: #66bb6a;
}

body.dark-mode #backToTop:hover {
    background-color: #4caf50;
}

/* 英雄区域样式 */
.hero {
    background-color: #4CAF50;
    color: #fff;
    padding: 5rem 0;
    text-align: center;
    margin-top: 4rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    background-color: #fff;
    color: #4CAF50;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #f0f0f0;
}

/* 关于我区域样式 */
.about {
    padding: 4rem 0;
    background-color: #fff;
}

.about h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.about-image {
    flex: 1;
    min-width: 300px;
    margin-right: 2rem;
}

.profile-img {
    width: 100%;
    max-width: 300px;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.about-text {
    flex: 2;
    min-width: 300px;
}

.about-text p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* 时间线样式 */
.timeline {
    margin: 4rem 0;
}

.timeline h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: #333;
}

.timeline-items {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-items::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: #4CAF50;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border: 4px solid #4CAF50;
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(odd)::after {
    right: -14px;
}

.timeline-item:nth-child(even)::after {
    left: -14px;
}

.timeline-date {
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 0.5rem;
}

.timeline-content {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
}

.timeline-content h4 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.timeline-content p {
    color: #666;
}

/* 个人成就样式 */
.achievements {
    margin-top: 2rem;
}

.achievements h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: #333;
}

.achievement-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.achievement-tag {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.achievement-tag:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

/* 项目作品区域样式 */
.projects {
    padding: 4rem 0;
    background-color: #f9f9f9;
}

.projects h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.project-item:hover {
    transform: translateY(-5px);
}

.project-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-item h3 {
    padding: 1rem;
    font-size: 1.2rem;
    color: #333;
}

.project-item p {
    padding: 0 1rem 1rem;
    color: #666;
}

.project-link {
    display: block;
    padding: 0 1rem 1rem;
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
}

.project-link:hover {
    text-decoration: underline;
}

/* 技能特长区域样式 */
.skills {
    padding: 4rem 0;
    background-color: #fff;
}

.skills h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

.skills-grid {
    max-width: 600px;
    margin: 0 auto;
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-name {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.skill-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background-color: #4CAF50;
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

/* 联系方式区域样式 */
.contact {
    padding: 4rem 0;
    background-color: #f9f9f9;
}

.contact h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

.contact-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.contact-info {
    flex: 1;
    min-width: 300px;
    margin-right: 2rem;
}

.contact-info p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.contact-info a {
    color: #4CAF50;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

.contact-form {
    flex: 1;
    min-width: 300px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-group button {
    background-color: #4CAF50;
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-group button:hover {
    background-color: #45a049;
}

/* 页脚样式 */
.footer {
    background-color: #333;
    color: #fff;
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
    }
    
    .nav-container {
        flex-direction: column;
        width: 100%;
        align-items: center;
        gap: 1rem;
    }
    
    .nav-links {
        margin-top: 1rem;
        flex-direction: column;
        align-items: center;
        width: 100%;
        text-align: center;
    }
    
    .nav-links li {
        margin: 0.5rem 0;
        width: 100%;
    }
    
    .language-switch {
        margin-bottom: 1rem;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .about-image {
        margin-right: 0;
        margin-bottom: 2rem;
    }
    
    .contact-content {
        flex-direction: column;
    }
    
    .contact-info {
        margin-right: 0;
        margin-bottom: 2rem;
    }
    
    /* 时间线响应式样式 */
    .timeline-items::after {
        left: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
    }
    
    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: 17px;
        right: auto;
    }
}

@media (max-width: 576px) {
    .container {
        width: 90%;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}